﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>链接</title>
    <link href="../../../Scripts/easyUI145/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/easyUI145/jquery.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/easyUI145/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../../Scripts/config.js" type="text/javascript"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../../Comm/Gener.js" type="text/javascript"></script>
    <script src="DDLBar.js" type="text/javascript"></script>
    <script src="../../EnumLab.js"></script>
    <script src="../../../Admin/Admin.js"></script>

    <script type="text/javascript">
        $(function () {

            //  InitBar(0);
            InitBar("Func");

            var frmID = GetQueryString("FrmID");

            var ens = new Entities("BP.CCBill.Template.Methods");
            ens.Retrieve("FrmID", frmID, "MethodModel", "Func");

            GenerBindDDL("DDL_Func", ens, "No", "Name");


        });

        function Save() {

            $("#Msg").html("正在创建,请稍后......");
            var name = $("#TB_Name").val();
            if (name == undefined || name == null || name == "") {
                alert("请输入方法名称.");
                return;
            }

            var methodId = $("#DDL_Func").val();
            if (methodId === "") {
                alert("请选择要执行的方法");
                return;
            }
            var en = new Entity("BP.CCBill.Template.Collection");
            en.FrmID = GetQueryString("FrmID");
            en.MethodID = methodId;
            en.Mark = "Func";
            en.Name = name;
            en.MethodModel = "Func";

            en.Icon = "icon-energy";
            en.Insert();

            var url = "../../../Comm/En.htm?EnName=BP.CCBill.Template.CollectionFunc&No=" + en.No;
            SetHref(url);
        }
        function onchangeIt() {

            var val = $("#DDL_Func option:selected").text();
            if (val == "- 请选择 -")
                return;

            $("#TB_Name").val(val);
        }
    </script>
</head>
<body>
    <div id="bar">
    </div>

    <fieldset>
        <legend>链接或者按钮</legend>
        <table>
            <tr>
                <td>标签: </td>
                <td>  <input type="text" value="" id="TB_Name" name="TB_Name" /></td>
                <td>可以批量执行的方法</td>
                <td>
                    <select id="DDL_Func" name="DDL_Func" onchange="onchangeIt();"></select>
                </td>
            </tr>
        </table>
        <div id="Msg"></div>

        <legend> 配置说明</legend>
        <ul>
            <li> 能够批量执行的方法也必能单个执行。 </li>
            <li> 定义实体的方法，可以在实体组件中设置。 </li>

        </ul>
    </fieldset>

</body>
</html>
